#pragma once

class IGameStateBase;
class CPatrolState: public IGameStateBase
{
    inline void Warrior();
    inline void Paladin();
    inline void Hunter();
    inline void Rogue();
    inline void Priest();
    inline void DeathKnight();
    inline void Shaman();
    inline void Mage();
    inline void Warlock();
    inline void Druid();
protected:
    typedef std::vector<sPos> VecPos;
    VecPos& m_ListPos;
    //VecPos::iterator itr;
    sPos&   m_sNextPosition;
    bool PatrolDoSomething();
    virtual sPos GetNextPos();
    virtual sPos GetBestPos();
public:
    CPatrolState();
    virtual ~CPatrolState(){};
    virtual void Reset();
    virtual void DoAction();
};

class CCirclePatrol:public CPatrolState
{
public:
    CCirclePatrol(){}
    ~CCirclePatrol(){};
    virtual void Reset()
    {
        m_sNextPosition = GetBestPos();
    }
    virtual sPos GetNextPos();
    //virtual sPos GetBestPos();
};

class CRandomPatrol:public CPatrolState
{
public:
    CRandomPatrol(){}
    ~CRandomPatrol(){};
    virtual sPos GetNextPos();
    virtual sPos GetBestPos();
    virtual void Reset()
    {
        m_sNextPosition = GetNextPos();
    }
    //virtual void DoAction();
};

class CLinePatrol:public CPatrolState
{
    int m_iDirection;
    DWORD m_dwIndex;
public:
    CLinePatrol():m_iDirection(1){}
    ~CLinePatrol(){};
    virtual void Reset()
    {
        m_sNextPosition = GetBestPos();
        m_dwIndex = 0;
        if (GET_DB().m_dwPatrolType==ENUM_FB_PATROL || 
            GET_DB().m_dwPatrolType==ENUM_FB_WAIT)
        {
            m_iDirection = 1;
        }
        //
    }
    virtual sPos GetNextPos();
    virtual void DoAction();
};

class CStandPatrol:public CPatrolState
{
public:
    CStandPatrol(){} 
    ~CStandPatrol(){};
    sPos GetNextPos();
    sPos GetBestPos();
    void DoAction(){};
};

class CFishingPatrol:public CPatrolState
{
public:
    CFishingPatrol(){} 
    ~CFishingPatrol(){};
    sPos GetNextPos();
    sPos GetBestPos();
    void DoAction();
};
